package core.actions;

import java.awt.Point;

import core.*;
import core.units.Unit;
import core.weapons.*;


public class FireShotgun extends Action {
	
	public FireShotgun(){
		super();
		name="Shotgun";
		imageName="iconShotgun.png";
		color = ActionConstants.attackColor;
		nameChar='S';
		needDir=true;
		energyCost=40;
		value=30;
		dirRes=2;
		reset();
	}
	
	public void execute(){
		//Player master = PlayerIdHandler.getPlayer(masterId);
		double span=0.04;
		int bullets=10;
		for(double d=inputDir-span/2; d<inputDir+span/2; d=d+span/bullets)
			main.attacks.add(new Bullet(master.getHero().getX(), master.getHero().getY(), master, d, 50, 4000, 0.01, 300000));
		/*~~~~(>o_o)>d===) Need better system for bullets b <('_'<)~~~~*/
		System.out.println("Shotgun Fired");
	}
}
